$OpenBSD: patch-src_tk_tkselect_c,v 1.2 2017/05/09 13:01:42 espie Exp $
Index: src/tk/tkselect.c
--- src/tk/tkselect.c.orig
+++ src/tk/tkselect.c
@@ -1132,7 +1132,7 @@ SelCvtFromX(propPtr, numValues, type, tkwin)
 	if (type == XA_ATOM) {
 	    strcpy(result+curSize, atomName);
 	} else {
-	    sprintf(result+curSize, "%#x", *propPtr);
+	    sprintf(result+curSize, "%#lx", *propPtr);
 	}
 	curSize += strlen(result+curSize);
     }
@@ -1856,7 +1856,7 @@ DefaultSelection(winPtr, target, buffer, maxBytes, typ
 	if (maxBytes < 20) {
 	    return -1;
 	}
-	sprintf(buffer, "%#x", winPtr->dispPtr->selectionTime);
+	sprintf(buffer, "%#lx", winPtr->dispPtr->selectionTime);
 	*typePtr = XA_INTEGER;
 	return strlen(buffer);
     }
